$(function(){
	$(".btn-login").click(function(){
		var userName = $('#userName').val();
	   if(userName==null || userName==''){
		   alert("请输入用户名");
		   return false;
	   }
	   var password = $('#password').val();
	   if(password==null || password==''){
		   alert("请输入密码");
		   return false;
	   }
	   var data={
			   userName:userName,
	           password:password
	   };
	   $.ajax({
		  type:'POST',
		  url:'/movie.front/loginController/loginUser',
		  dataType:'json',
		  contentType : "application/json",
		  data:JSON.stringify(data),
		  success:function(data){
			if(data.errorcodeInfo!=null){
				alert(data.errorcodeInfo.errorcode);
			}else{
				//进入购物页面
				window.location.href="/movie.web/indexmain.html"
			}
		  },
	 
		  
		  
		   
	   });
	    
	
	});
});